/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the 'License');
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import ir from '~/vendor/arkanalyzer';
import ts from '~/vendor/ohos-typescript';

import { EngineCapabilityHint } from '~/extensions';
import { Location } from '~/type/Generic';

/**
 * @category Hint
 */
export interface HomeCheckHint extends EngineCapabilityHint {
    options: { use: 'ast' | 'ir' };
    config: object[];
    native: HomeCheckNative;
    issue: HomeCheckIssue;
    issueTemplate: HomeCheckIssueTemplate;
}

/**
 * @category Hint
 */
export interface HomeCheckAstHint extends HomeCheckHint {
    node: ts.Node;
}

/**
 * @category Hint
 */
export interface HomeCheckIrHint extends HomeCheckHint {
    node: ir.Stmt;
}

/**
 * @category Hint
 */
export interface HomeCheckNative {
    rule: HomeCheckRule;
}

/**
 * @category Hint
 */
export interface HomeCheckRule {
    ruleId: string;
    alert: number;
    allowExpressions: boolean;
    ignoreRestArgs: boolean;
    option: [];
}

/**
 * @category Hint
 */
export interface HomeCheckIssue {
    location: Location;
    description: string;
    severity?: number;
    docPath?: string;
}

/**
 * @category Hint
 */
export interface HomeCheckIssueTemplate {
    description: string;
    severity?: number;
    docPath?: string;
}
